import request from '@/utils/request'

export function getInfo(query) {
  return request({
    url: '/scm/greenchain/query',
    method: 'get',
    params: query
  })
}

export function add(data) {
  return request({
    url: '/scm/greenchain',
    method: 'put',
    data
  })
}
export function del(id) {
  return request({
    url: `/scm/greenchain/${id}`,
    method: 'delete'

  })
}
export function uploadFile(id, data) {
  return request({
    url: `/scm/greenchain/uploadFile/${id}`,
    method: 'post',
    data
  })
}
export function downloadFile(id) {
  return request({
    url: `/scm/greenchain/downloadFile/${id}`,
    method: 'get',
    responseType: 'arraybuffer'
  })
}
export function delfile(id) {
  return request({
    url: `/scm/greenchain/uploadFile/cancel/${id}`,
    method: 'put'
  })
}
export function getfile(id) {
  return request({
    url: `/scm/greenchain/file/${id}`,
    method: 'get'
  })
}
export function total(id) {
  return request({
    url: `/scm/greenchain/total/${id}`,
    method: 'get'
  })
}
export function totalUncheck(id) {
  return request({
    url: `/scm/greenchain/totalUncheck/${id}`,
    method: 'get'
  })
}

